#include <iostream>
#include <initializer_list>
#include <tuple>

int main() {
    // auto的使用
    auto num = 42;
    std::cout << "使用auto推断出的变量num的类型为整数，值为: " << num << std::endl;

    // decltype的使用
    auto str = "Hello, C++11";
    decltype(str) anotherStr = "New string";
    std::cout << "使用decltype根据str获取类型并定义的anotherStr: " << anotherStr << std::endl;

    // nullptr的使用
    int* intPtr = nullptr;
    if (intPtr == nullptr) {
        std::cout << "intPtr是一个空指针" << std::endl;
    }

    // std::initializer_list的使用
    std::initializer_list<int> intList = {1, 2, 3, 4, 5};
    std::cout << "std::initializer_list中的元素: ";
    for (auto value : intList) {
        std::cout << value << " ";
    }
    std::cout << std::endl;

    // std::tuple的使用
    std::tuple<int, float, char> myTuple(10, 3.14f, 'A');
    std::cout << "std::tuple中的元素: ";
    std::cout << std::get<0>(myTuple) << " ";
    std::cout << std::get<1>(myTuple) << " ";
    std::cout << std::get<2>(myTuple) << std::endl;

    return 0;
}